package mdt.figure;

import mdt.model.ITextEdge;
import org.tigris.gef.presentation.Fig;

/**
 * Created by lambert on 2016/6/20.
 */
public class FigTextEdge extends FigShapedEdge{
	private static final long serialVersionUID = 1L;

	public FigTextEdge(ITextEdge owner) {
		super(owner);
	}

	public void setOwner(Object owner) {
		getFig().setOwner(((ITextEdge)owner).getComment());
		super.setOwner(owner);
	}

	@Override
	protected Fig makeEdgeFig() {
		return new FigRichText(null);
	}

	public void setFig(Fig f) {
		super.setFig(f);
		((FigNodeEditable)f).getFigText().setEnableArc(true);
		if (getOwner() != null) {
			((FigNodeEditable)f).setOwner(((ITextEdge)getOwner()).getComment());
		}
	}

	public boolean isSelfEdgeEnabled() {
		return true;
	}

}
